package cn.stylefeng.guns.sys.modular.tao.mapper;

import cn.stylefeng.guns.sys.modular.tao.entity.Classification;
import cn.stylefeng.guns.sys.modular.tao.entity.Goods;
import cn.stylefeng.guns.sys.modular.tao.model.params.GoodsParam;
import cn.stylefeng.guns.sys.modular.tao.model.result.GoodsResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 商品表 Mapper 接口
 * </p>
 *
 * @author 
 * @since 2019-08-09
 */
@Repository
public interface GoodsMapper extends BaseMapper<Goods> {

    /**
     * 获取列表
     *
     * @author 
     * @Date 2019-08-09
     */
    List<GoodsResult> customList(@Param("paramCondition") GoodsParam paramCondition);

    /**
     * 获取map列表
     *
     * @author 
     * @Date 2019-08-09
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") GoodsParam paramCondition);

    /**
     * 获取分页实体列表
     *
     * @author 
     * @Date 2019-08-09
     */
    Page<GoodsResult> customPageList(@Param("page") Page page, @Param("paramCondition") GoodsParam paramCondition);

    /**
     * 获取分页map列表
     *
     * @author 
     * @Date 2019-08-09
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") GoodsParam paramCondition);

    List<GoodsResult> getAllGoods(Map<String, Object> params);

    void updates(Goods goods);

    void updateById(@Param("id")String id,@Param("price")String price);

    Goods getByIds(@Param("id") Long id);

    List<GoodsResult> getAllGoodsAndSku();

    List<Goods> getGoodsClass();

    Integer updateByClass(@Param("Data") Classification classificationParam);

    List<String> getAllGoods2And();

    List<GoodsResult> lists(Map<String, Object> map);

    int counts(Map<String, Object> map);

    List<GoodsResult> getGoodsAll();

    GoodsResult getGoodsByGoodsId(@Param("id") String id);

    List<GoodsResult> getGoodsByName(@Param("name") String name,@Param("index") String index,@Param("end") String end);


    /**
     * 根据分类查询数据
     */
    List<GoodsResult> queryDataAccordingToClassification(@Param("ids") String ids);

    int getgoodsById(String goodId);


    void addPrice(@Param("goodId") String goodId,@Param("price") String price);


    /**
     * 修改图文视频的id
     */
    void updataPictureVideoId(Goods goods);

    void updateType(GoodsParam goodsParam);

}
